/**
 * 
 */
package com.sesame.daoimpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sesame.dao.ReShareDAO;
import com.sesame.domain.ReShare;

/**
 * @author voidman
 * 
 */
public class ReShareDAOImpl extends SqlMapClientDaoSupport implements ReShareDAO {

    public void addReShare(ReShare ReShare) {
        getSqlMapClientTemplate().insert("addReShare", ReShare);
    }

    public void deleteReShareById(Integer id) {
        getSqlMapClientTemplate().delete("deleteReShareById", id);
    }

    @SuppressWarnings("unchecked")
    public List<ReShare> getAllReShare() {
        List<ReShare> listReShare;
        listReShare = getSqlMapClientTemplate().queryForList("getAllReShare");
        return listReShare;
    }
    
    public ReShare getReShareById(Integer id) {

        return (ReShare) getSqlMapClientTemplate().queryForObject("getReShareById", id);
    }

    public void updateReShare(ReShare ReShare) {
        getSqlMapClientTemplate().update("updateReShare", ReShare);
    }

}
